<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>原料仓库管理系统</title>
</head>
<?php 
require('lianjie.php');
?>

<body>
<?php 

if(isset($_POST['WBK_text'])){
	$WBK_text=$_POST['WBK_text'];
	$n=0;
	for($i=1;$i<=substr_count($WBK_text,"';");$i++){
		//echo $n.",,";
		$sql=substr($WBK_text,$n,str_n_pos($WBK_text,"';",$i)-str_n_pos($WBK_text,"';",$i-1));
		echo $sql.",,,";
		if(mysqli_select_db($connID,$dbName)){
			mysqli_query($connID,$sql);}
		//$i=$i+strpos($WBK_text, ";")+1;
		$n=str_n_pos($WBK_text,"';",$i)+4;
		//echo $n.",,";
	}
	//echo substr_count($WBK_text,";");
	//echo str_n_pos($WBK_text,";",1);
	echo"<script type='text/javascript'>alert('数据修改成功！');location='CKGL_plupdata.php';</script>";
}
else{
	echo"<script type='text/javascript'>alert('数据输入不完整，请重新输入！');location='CKGL_plupdata.php';
				</script>";
}/**/

function str_n_pos($str,$find,$n){
	$pos_val=0;
        for ($i=1;$i<=$n;$i++){
            $pos = strpos($str,$find);
            $str = substr($str,$pos+1);
            $pos_val=$pos+$pos_val+1;
        }
		$count = $pos_val-1;	
        return $count; 
    }
?>
</body>
</html>